package cn.kgc.dao;

import cn.kgc.entity.Goods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface GoodsRepository extends JpaRepository<Goods,Integer> {

    /**
     * 自定义查询所有信息
     */
    @Query(value = "select * from goods",nativeQuery = true)
    List<Goods> getAll();


}
